home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
-
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
- <xsl:output method="html"/>
-
- <xsl:variable name="common-styles">
- <style type="text/css">
- body { font: 11pt/17pt "Trebuchet MS", Tahoma, sans-serif; margin: 8px 10px; color: #1F1F1F; background-color: white; }
- a { color: #006ABA; }
- a:hover { color: #6F94C3; }
- span.nodescription { font-size: x-small; color: silver;}
- div.newspapertitle { font-weight: bold; font-size: 130%; text-align: center; margin: 16px 2px; }
- div.newsitem { /*border: 1px dotted #484848;*/ padding: 18px 24px; background-color: white; }
- div.newsitemtitle { font-weight: bold; }
- div.newsitemfooter { font-size: xx-small; text-align: left; margin-bottom: 8px; }
- div.newsitemfooter, div.newsitemfooter a { color: #AEAEAE; }
- <xsl:if test="newspaper[@type != 'newsitem']">
- div.newsitem {
- border-bottom: 1px dotted #D8D8D8;
- }
- </xsl:if>
- </style>
- </xsl:variable>
-
- <!-- channel group -->
- <xsl:template match="newspaper[@type='group']">
- <html>
- <head>
- <title>Group Newspaper</title>
- <xsl:copy-of select="$common-styles"/>
- <style type="text/css">
- div.channelnewsitems, div.channeltitle { border: 1px solid #CCCCCC; }
- div.channelnewsitems { padding: 8px 12px; margin-bottom: 12px; }
- div.channeltitle { border-bottom: none; font-weight: bold; text-transform: uppercase; color: #534700; text-align: center; }
- </style>
- </head>
- <body>
- <xsl:variable name="newspapertype" select="@type"/>
- <xsl:if test="title">
- <div class="newspapertitle">
- <xsl:value-of select="title" disable-output-escaping="yes"/>
- </div>
- </xsl:if>
-
- <xsl:for-each select="channel">
- <div class="channeltitle">
- <xsl:value-of select="title"/>
- </div>
- <div class="channelnewsitems">
- <xsl:for-each select="item">
- <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- </div>
- </xsl:for-each>
- </body>
- </html>
- </xsl:template>
-
- <!-- news item and channel -->
- <xsl:template match="newspaper[@type='newsitem' or @type='channel']">
- <html>
- <head>
- <title>Newspaper</title>
- <xsl:copy-of select="$common-styles"/>
- </head>
- <body>
- <xsl:if test="title">
- <div class="newspapertitle">
- <xsl:value-of select="title" disable-output-escaping="yes"/>
- </div>
- </xsl:if>
- <xsl:for-each select="channel/item">
- <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- </body>
- </html>
- </xsl:template>
-
- <!-- news item template -->
- <xsl:template match="item">
- <div class="newsitem">
- <div class="newsitemtitle">
- <xsl:variable name="itemlink" select="link"/>
- <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
- </div>
- <div class="newsitemfooter">
- <xsl:variable name="srclink" select="source/@htmlUrl"/>
- <xsl:value-of select="fd:dateDisplay"/> | <a href="{$srclink}"><xsl:value-of select="source"/></a>
- <!-- add link to comments if available -->
- <xsl:if test="comments">
- <xsl:variable name="commentlink" select="comments"/>
- <xsl:variable name="commentimg" select="'$IMAGEDIR$comments.gif'"/>
- | <a href="{$commentlink}"><img src="{$commentimg}" border="0" hspace="3" align="absmiddle" /></a>
- </xsl:if>
- <!-- add link to enclosure if available -->
- <xsl:if test="enclosure">
- <xsl:variable name="enclosurelink" select="enclosure/@url"/>
- <xsl:variable name="enclosureimg" select="'$IMAGEDIR$enclosure.gif'"/>
- | <a href="{$enclosurelink}" title="{$enclosurelink}"><img src="{$enclosureimg}" border="0" hspace="3" align="absmiddle" /></a>
- </xsl:if>
- </div>
- <div class="newsitemcontent">
- <xsl:value-of select="description" disable-output-escaping="yes"/>
- </div>
- </div>
- </xsl:template>
-
- </xsl:stylesheet>